<extend name="Public:innerbase" />
<block name="content">
	<div class="container-fluid">
		<div class="page-header wm-page-header">
			<h3>文章列表</h3>
			<form class="form-inline" method="get" action="{:U('index')}" id="form1">
				<div class="form-group">
					<a class="btn btn-success" href="{:U('article/edit',['cate'=>$_GET['cate']])}">
					<span class="glyphicon glyphicon-plus"></span>添加文章
					</a>
				</div>
				<div class="form-group">
					<select name="cate" class="form-control" onchange="$('#form1').submit()">
						<option value="0">全部分类</option>
						<volist name="cates" id="cate">
						<option value="{$cate.id}" <eq name="cate['id']" value="$_GET['cate']">selected</eq>>{$cate.name}</option>
						</volist>
					</select>
				</div>
                <input type="text" class="form-control" placeholder="文章标题，内容..." value="{$_GET['find']}" name="find">
				<button type="submit" class="btn btn-default"><i class="glyphicon glyphicon-search"></i>&nbsp;查找</button>
			</form>
		</div>
		<table class="table wm-table-bordered table-striped table-hover">
			<thead>
				<tr>
					<th>文章标题</th>
					<th>作者</th>
					<th>分类</th>
					<th>创建时间</th>
					<th>排序</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
				<volist name="articles" id="vo">
				<tr>
					<td>{$vo.title}</td>
					<td>{$vo.author}</td>
					<td>{$vo.catname}</td>
					<td>{$vo.createtime|date="Y-m-d H:i",###}</td>
					<td>{$vo.sort}</td>
					<td>
						<a href="{:U('edit',array('id'=>$vo['id'],'cate'=>$_GET['cate'],'p'=>$_GET['p']))}" class="btn btn-primary btn-xs">编辑</a>
						<a href="{:U('delete',array('id'=>$vo['id']))}" class="btn btn-danger btn-xs">删除</a>
					</td>
				</tr>
				</volist>
			</tbody>
		</table>
		<div>{$page}</div>
	</div>
</block>